#!/usr/bin/env python
# -*- coding:utf-8 -*-
# @FileName  :RSA生成公私钥.py
# @Time      :2024/4/12 15:10
# @Author    :Sherlock
from Crypto.PublicKey import RSA

rsa_obj = RSA.generate(1024)

with open("publick_key.pem", "wb") as f:
    f.write(rsa_obj.publickey().export_key())

with open("private_key.pem", "wb") as f:
    f.write(rsa_obj.export_key())
